<%@page import="com.project.service.ProjectInfoService"%>
<%@page import="com.project.service.Impl.ProjectInfoServiceImpl"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<style>
* {
	text-align: center;
	line-height: 40px
}

h1 {
	width: 1300px;
}

table {
	width: 1300px;
}

tr td:nth-of-type(2) {
	width: 300px;
}

tr td:nth-of-type(2) ~td {
	width: 200px;
}

tr td a {
	display: inline-block;
	margin: 0px 10px;
}
</style>
<body>
	<form action="" method="post">
		<h1>申报项目列表</h1>
		<table>
			<tr style="background: #808080;">
				<td>编号</td>
				<td>申报名称</td>
				<td>申报开始日期</td>
				<td>申报结束日期</td>
				<td>申报状态</td>
				<td>操作</td>
			</tr>
			<c:forEach items="${pros }" var="i" varStatus="vs">
				<tr
					<c:if test="${vs.index%2==0}">style='background:lightBlue;'</c:if>>
					<td>${i.id }</td>
					<td>${i.projectName }</td>
					<td>${i.startDate }</td>
					<td>${i.endDate }</td>
					<td><c:choose>
							<c:when test="${i.status eq 0 }">未申报</c:when>
							<c:when test="${i.status eq 1 }">审核中</c:when>
							<c:otherwise>已审核</c:otherwise>
						</c:choose></td>
					<td>
						<a href="QueryByIdProServlet?updateId=${i.id }">修改</a> 
						<a href="javascript:if(confirm('确认删除么?')){window.location.href='DelProServlet?delId=${i.id }'}">删除</a> 
						<a href="add.jsp">新增</a>
					</td>
				</tr>
			</c:forEach>
				<tr>
					<td colspan="6">
						<a href="ProjectInfoServlet?page=1">首页</a> 
						<c:choose>
							<c:when test="${pageNo le 1 }">
								<a href="javascript:alert('已经是第一页了')">上一页</a> 
							</c:when>
							<c:otherwise>
								<a href="ProjectInfoServlet?page=${pageNo-1 }">上一页</a> 
							</c:otherwise>
						</c:choose>
						<c:choose>
							<c:when test="${pageNo ge totalPageCount }">
								<a href="javascript:alert('已经是最后一页了')">下一页</a>
							</c:when>
							<c:otherwise>
								<a href="ProjectInfoServlet?page=${pageNo+1 }">下一页</a>
							</c:otherwise>
						</c:choose>
						
						<a href="ProjectInfoServlet?page=${totalPageCount }">尾页</a>
					</td>
				</tr>
		</table>

	</form>
</body>
</html>